import http from "../utils/request"

//分类分页  /admin/sort/sortPage
const sortPage = (data) => {
    return http.request({
        url: '/admin/sort/sortPage',
        method: 'get',
        data: data
    })
}

//分类下拉框 /admin/sort/sortSelect
const sortSelect = () => {
    return http.request({
        url: '/admin/sort/sortSelect',
        method: 'get'
    })
}

//分类信息详情 /admin/sort/{id}
const sortInfo = (data) => {
    return http.request({
        url: '/admin/sort/' + data.id,
        method: 'get',
        data: data
    })
}

//删除分类 /admin/sort/{id}
const sortDelete = (data) => {
    return http.request({
        url: '/admin/sort/' + data.id,
        method: 'delete',
        data: data
    })
}

//新增分类 /admin/sort/addSort
const addSort = (data) => {
    return http.request({
        url: '/admin/sort/addSort',
        method: 'post',
        data: data
    })
}

//修改分类 /admin/sort/updateSort
const updateSort = (data) => {
    return http.request({
        url: '/admin/sort/updateSort',
        method: 'post',
        data: data
    })
}

//标签下拉框 /admin/label/labelSelect
const labelSelect = (sortId) => {
    return http.request({
        url: '/admin/label/labelSelect?sortId=' + sortId,
        method: 'get'
    })
}

//修改标签 /admin/label/updateLabel
const updateLabel = (data) => {
    return http.request({
        url: '/admin/label/updateLabel',
        method: 'post',
        data: data
    })
}

//新增标签 /admin/label/addLabel
const addLabel = (data) => {
    return http.request({
        url: '/admin/label/addLabel',
        method: 'post',
        data: data
    })
}

//标签详情
const labelInfo = (data) => {
    return http.request({
        url: '/admin/label/' + data.id,
        method: 'get',
        data: data
    })
}

//标签删除
const labelDelete = (data) => {
    return http.request({
        url: '/admin/label/' + data.id,
        method: 'delete',
        data: data
    })
}

//标签列表 /admin/label/labelPage
const labelList = (data) => {
    return http.request({
        url: "/admin/label/labelPage",
        method: "get",
        data: data
    })
}

export {
    sortPage,
    sortInfo,
    sortSelect,
    sortDelete,
    addSort,
    updateSort,
    labelList,
    labelSelect,
    labelInfo,
    labelDelete,
    addLabel,
    updateLabel
}


